<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="guide-item">
    <image class="guide-item-img" :src="info.pic" mode="aspectFill" />
    <view class="guide-item-tag">{{ info.name }}</view>
    <view class="guide-item-desc">{{ info.one_word }}</view>
    <view class="guide-item-line"></view>
  </view>
</template>

<style lang="scss">
.guide-item {
  position: relative;

  .guide-item-img {
    display: block;
    width: 100%;
    height: 392rpx;
    border-radius: 20rpx;
  }

  .guide-item-tag {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0 14rpx;
    font-size: 26rpx;
    color: #7d3f00;
    line-height: 56rpx;
    font-weight: bold;
    border-radius: 0 20rpx 10rpx 10rpx;
    background: linear-gradient(180deg, #f7c777, #ffead6);
  }

  .guide-item-desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10rpx 20rpx 8rpx;
    font-size: 28rpx;
    color: #ffffff;
    line-height: 40rpx;
    font-weight: bold;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
    border-radius: 0 0 20rpx 20rpx;
    background-color: rgba(0, 0, 0, 0.35);
  }

  .guide-item-line {
    position: absolute;
    top: 30rpx;
    right: -14rpx;
    bottom: 30rpx;
    width: 14rpx;
    border-radius: 0 20rpx 0 0;
    background: linear-gradient(
      180deg,
      #e4e4e4,
      rgba(231, 231, 231, 0.49) 71%,
      rgba(255, 255, 255, 0)
    );
  }
}
</style>